//
//  Backpack.h
//  parachute
//
//  Created by Zach A. Thomas on 12/14/06.
//  Copyright 2006 Aeroplane Software, LLC. All rights reserved.
//

#import <Cocoa/Cocoa.h>


@interface Backpack : NSObject {
	NSString *apiKey;
	NSString *username;
	NSNumber *currentPageId;
}
// initialization and setup
- (id)initWithApiKey:(NSString *)apiKey:(NSString *)username;
- (void)connect;
- (NSData *)request:(NSString *)path:(NSDictionary *)parameters:(BOOL)secondTry;
- (void)setPageId:(NSNumber *)pageId;

// items
- (NSArray *)listItems:(NSNumber *)pageId;
- (void)createItem:(NSString *)content:(NSNumber *)pageId;
- (void)updateItem:(NSNumber *)itemId:(NSString *)content:(NSNumber *)pageId;
- (void)destroyItem:(NSNumber *)itemId:(NSNumber *)pageId;
- (void)toggleItem:(NSNumber *)itemId:(NSNumber *)pageId;
- (void)moveItem:(NSNumber *)itemId:(NSString *)direction:(NSNumber *)pageId;

// notes
- (NSArray *)listNotes:(NSNumber *)pageId;
- (void)createNote:(NSString *)title:(NSString *)body:(NSNumber *)pageId;
- (void)updateNote:(NSNumber *)noteId:(NSString *)title:(NSString *)body:(NSNumber *)pageId;
- (void)destroyNote:(NSNumber *)noteId:(NSNumber *)pageId;

// emails
- (NSArray *)listEmails:(NSNumber *)pageId;
- (NSDictionary *)showEmail:(NSNumber *)emailId:(NSNumber *)pageId;
- (void)destroyEmail:(NSNumber *)emailId:(NSNumber *)pageId;

// tags
- (NSArray *)listPagesWithTag:(NSString *)tag;
- (void)tagPage:(NSArray *)tags:(NSNumber *)pageId;

// pages
- (NSArray *)listPages;
- (void)createPage:(NSString *)title:(NSString *)body;
- (NSDictionary *)showPage:(NSNumber *)pageId;
- (void)destroyPage:(NSNumber *)pageId;
- (void)updateTitle:(NSString *)title:(NSNumber *)pageId;
- (void)updateBody:(NSString *)body:(NSNumber *)pageId;
- (void)linkPage:(NSNumber *)linkedPageId:(NSNumber *)pageId;
- (void)unlinkPage:(NSNumber *)linkedPageId:(NSNumber *)pageId;
- (void)sharePage:(NSArray *)emailAddresses:(BOOL)isPublic:(NSNumber *)pageId;

// reminders
- (NSArray *)listReminders;
- (void)createReminder:(NSString *)content:(NSDate *)remindAt;
- (void)updateReminder:(NSNumber *)reminderId:(NSString *)content:(NSDate *)remindAt;
- (void)destroyReminder:(NSNumber *)reminderId;

// separators
- (void)createSeparator:(NSString *)name:(NSNumber *)pageId;
- (void)updateSeparator:(NSNumber *)separatorId:(NSString *)name:(NSNumber *)pageId;
- (void)destroySeparator:(NSNumber *)separatorID:(NSNumber *)pageId;

@end
